<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateUsuarioTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_usuarioId}" for="usuarioId" />
                    <h:inputText id="usuarioId" value="#{usuarioController.selected.usuarioId}" title="#{bundle.CreateUsuarioTitle_usuarioId}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_usuarioId}"/>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{usuarioController.selected.nome}" title="#{bundle.CreateUsuarioTitle_nome}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_nome}"/>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_email}" for="email" />
                    <h:inputText id="email" value="#{usuarioController.selected.email}" title="#{bundle.CreateUsuarioTitle_email}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_email}"/>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_password}" for="password" />
                    <h:inputText id="password" value="#{usuarioController.selected.password}" title="#{bundle.CreateUsuarioTitle_password}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_password}"/>
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_superusuario}" for="superusuario" />
                    <h:inputText id="superusuario" value="#{usuarioController.selected.superusuario}" title="#{bundle.CreateUsuarioTitle_superusuario}" />
                    <h:outputLabel value="#{bundle.CreateUsuarioLabel_grupoId}" for="grupoId" />
                    <h:selectOneMenu id="grupoId" value="#{usuarioController.selected.grupoId}" title="#{bundle.CreateUsuarioTitle_grupoId}" required="true" requiredMessage="#{bundle.CreateUsuarioRequiredMessage_grupoId}">
                        <f:selectItems value="#{grupoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{usuarioController.create}" value="#{bundle.CreateUsuarioSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{usuarioController.prepareList}" value="#{bundle.CreateUsuarioShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateUsuarioIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
